home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / PlainTalk Developer / Text-to-Speech / Installer Source / TTS_Mexican_14_Install.r < prev   
Encoding:
Text File  |  1995-04-17  |  15.4 KB  |  533 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2.  *
  3.  *  Mexican Text-to-Speech Installer: 
  4.  *                Installation of Mexican Text-to-Speech software
  5.  *
  6.  *                Copyright © 1994 Apple Computer, Inc.
  7.  *                All rights reserved.
  8.  *
  9.  *    File:        TTS_Mexican_14_Install.r -    Rez Source
  10.  *
  11.  *    Author:        Deric Horn
  12.  *
  13.  *    History:    <1>    (11/8/94) Created this file.
  14.  *
  15.  *    Build:        
  16.     Make -f 'Installer Script.make' 'Mexican TTS Install Script'
  17.  *
  18.  *----------------------------------------------------------------------------*/
  19. #include    "InstallerTypes.r"
  20. include        "MexicanSpanishTTS.rsrc";                        /* vers and splash resources */
  21.  
  22. //    Definition for the user function    //    Gestalt user functions
  23. #define    chkNotProcessor                1002
  24. include "GestaltFxns.rsrc" 'infn' (1002)  as 'infn' (chkNotProcessor);
  25.  
  26. #if    (Debug)
  27.     include        "Installer Debugger.rsrc" NOT 'vers';
  28. #endif
  29.  
  30. /* Date is the current release date put in 'icmt' rsrc. ScriptCheck will convert  */
  31. #define currentReleaseDate            4301995                    /* Official release date */
  32. #define kTTSVersion                    "1.4"                     /* Version */
  33. #define kTTSVersionIcmt                140                         /* Version goes in the 'icmt' rsrc */
  34.  
  35. /* CONSTANTS: put a 1 in the creation date field of source 'infs' to have ScriptCheck set date */
  36. #define kScriptCheckSetsDate        0x01
  37. #define kMinMemMB                    04                /*NOT Used*/    /* memory needed to install (UPDATE Error Message if changed!)*/
  38.  
  39.  
  40.     // Assertions.  Must all have unique values.
  41.     
  42. #define aBootableVolume            1        // Chosen volume can be booted from.
  43. #define aSystem7                2        // Chosen volume has System 7.5 or later installed.
  44. #define aProcessorOK            3        // This Mac has a CPU we can run on.
  45.  
  46.  
  47. /* RULE: Definitions for the rule */
  48. #define rlBootableVolume            1000
  49. #define rlSystem7                    1001
  50. #define rl68000                        1002
  51. #define rl68010                        1003
  52. #define rlProcessorOK                1004
  53. #define rlCheckSystemVersion        1005
  54. #define rlCheckBootable                1006
  55. #define rlCheckCPU                    1007
  56. #define rlOKToInstall                1008
  57. #define rlCustomCheckSystem            1012
  58. #define rlCustomSystemVersionError    1013
  59.  
  60. #define diskOrder                    1000                    /* for indo resource */
  61.  
  62. #define sourceFileBase                3000
  63. #define targetFileBase                4000
  64. #define actionAtomBase                sourceFileBase
  65. #define    kTargetSystem                5000                    // System file.
  66. #define kTargetFinder                5001                    // Finder.
  67.  
  68. /* PACKAGES: Definition of the packages. */
  69. #define pkInstallMexicanTTS                3003
  70. #define pkInstallSpeechMgrCustom        3004
  71. #define pkInstallSpeechCDevCustom        3010
  72. #define pkInstallSpeechMgrExtCustom        3011
  73.  
  74. /* COMMENT: Definition for the package comment resource */
  75. #define cmtIMexicanTTS                pkInstallMexicanTTS
  76. #define cmtISpeechMgr                pkInstallSpeechMgrCustom
  77. #define cmtISpeechCDev                pkInstallSpeechCDevCustom
  78. #define cmtISpeechMgrExt            pkInstallSpeechMgrExtCustom
  79.  
  80. #define iconMexicanTTS                pkInstallMexicanTTS
  81. #define iconSpeechMgr                pkInstallSpeechMgrCustom
  82. #define iconSpeechCDev                pkInstallSpeechCDevCustom
  83. #define iconSpeechMgrExt            pkInstallSpeechMgrExtCustom
  84.  
  85. /* SOURCE DISK: This is the name of the source disks */
  86. #define ProgramDisk1                "Mexican TTS 1:"
  87. #define ProgramDisk2                "Mexican TTS 2:"
  88. #define ProgramDisk3                "Mexican TTS 3:"
  89.  
  90.  
  91. // File ID's
  92. // These need to be added to sourceFileBase or targetFileBase to get the full ID.
  93.  
  94. #define fReadMe                        1
  95. #define fSimpleText                    2
  96. #define fSpeechCDev                    3
  97. #define fSpeechMgr                    4
  98. #define fSynth                        5
  99. #define fSpeechCDevNoRemove            33
  100. #define fSpeechMgrNoRemove            34
  101. #define fCarlos                        50
  102. #define fCatalina                    51
  103. #define fDefaultVoice                100
  104. #define fCarlosExtFolder            250
  105. #define fCatalinaExtFolder            251
  106.  
  107.  
  108. /***************************** Preferences Resource *****************************************/
  109.  
  110. // The only reason we need a preferences resource is to specify the help pages.  We use
  111. // the defaults for all other fields.
  112.  
  113. resource 'inpr' ( 300 )                        // Required resource ID.
  114. {
  115.     format0
  116.     {
  117.         useDiskTargetMode,                    // Since always install in System Folder.
  118.         dontAllowUserToSetSystemDisk,        // Meaningless in Disk Target mode.
  119.         showSelectedSizeInCustom,            // Might be some help.
  120.         noSetupFunctionSupplied,            // None for now.
  121.         dontAllowCleanInstall,                // Not documented but sounds dangerous.
  122.         dontAllowServerAsTarget,            // Unsupported and totally dangerous.
  123.         
  124.         '', 0,                                // No Setup Function.
  125.         
  126.         {
  127.             401, 421, 401, 421,                // Help PICT resource ID's, page 1.
  128.             402, 422, 402, 422,                // Help PICT resource ID's, page 2.
  129.             403, 423, 403, 423,                // Help PICT resource ID's, page 3.
  130.             404, 424, 404, 424,                // Help PICT resource ID's, page 4.
  131.             405, 425, 405, 425,                // Help PICT resource ID's, page 5.
  132.         },
  133.         
  134.         ""                                    // Recommended folder name; not used.
  135.     }
  136. };
  137.  
  138. /***************************** indo Resource ************************************************/
  139. resource 'indo' (DiskOrder) {
  140.     format0 {{
  141.         ProgramDisk1,
  142.         ProgramDisk2,
  143.         ProgramDisk3,
  144.     }};
  145. };
  146.  
  147.  
  148. /*********************************** Global Rules ********************************************/
  149. //
  150. // Currently, the global rules only set assertions.
  151.  
  152. resource 'infr' ( kGlobalFrameworkRsrcID )                    /* Rule Framework */
  153. {
  154.     format0
  155.     {{
  156.             
  157.             // Each rule either sets an assertion, or not.
  158.             
  159.         pickAll,
  160.         {
  161.             rlBootableVolume,    // Determine whether the chosen volume can be a boot volume.
  162.             rlSystem7            // Determine which version of the OS is installed on the chosen volume.
  163.         },
  164.         
  165.         
  166.             // Determine whether we can run on this CPU.
  167.             
  168.         pickFirst,
  169.         {
  170.             rl68000,            // Is this a 68000 which we can't run on?
  171.             rl68010,            // Is this a 68010 which we can't run on?
  172.             rlProcessorOK        // If we get here, the CPU is OK.
  173.         }
  174.     }}
  175. };
  176.  
  177. //------------------------------
  178. // Test for the chosen volume being bootable.
  179.     
  180. resource 'inrl' ( rlBootableVolume )
  181. {
  182.     format0
  183.     {{
  184.         checkFileRsrcForkExists{ kTargetSystem },                    // does the system file exist
  185.         checkFileRsrcForkExists{ kTargetFinder },                    // does the finder exist
  186.         addAssertion{{ aBootableVolume }}
  187.     }}
  188. };
  189.  
  190. //------------------------------
  191. // Check whether chosen volume has System 7.0 or later.
  192.     
  193. resource 'inrl' ( rlSystem7 )
  194. {
  195.     format0
  196.     {{
  197.         checkAllAssertions{{ aBootableVolume }},
  198.         checkFileVersion{ kTargetSystem, 0x7, 0x00, release, 0x0 }, //    7.0.0 or later
  199.         addAssertion{{ aSystem7 }}
  200.     }}
  201. };
  202.  
  203. //------------------------------
  204. // Check whether this Mac has a particular processor.
  205.  
  206. #define gestaltProcessorType    'proc'
  207. #define gestalt68000            1
  208. #define gestalt68010            2
  209. #define gestalt68020            3
  210. #define gestalt68030            4
  211. #define gestalt68040            5
  212.  
  213. resource 'inrl' ( rl68000 )
  214. {
  215.     format0
  216.     {{
  217.         checkGestalt { gestaltProcessorType, { gestalt68000 } }        //    68000?
  218.     }}
  219. };
  220.  
  221. resource 'inrl' ( rl68010 )
  222. {
  223.     format0
  224.     {{
  225.         checkGestalt { gestaltProcessorType, { gestalt68010 } }        //    68010?
  226.     }}
  227. };
  228.  
  229. //------------------------------
  230. // Say that this Mac's CPU is one we support.
  231.     
  232. resource 'inrl' ( rlProcessorOK )
  233. {
  234.     format0
  235.     {{
  236.         addAssertion{{ aProcessorOK }}
  237.     }}
  238. };
  239.  
  240. /************************** Rule resources for Easy Install **********************************/
  241.  
  242. resource 'infr' ( kEasyInstallFrameworkRsrcID )
  243. {
  244.     format0
  245.     {{
  246.             // If System 7.0 isn't installed, alert and don't install.
  247.             // Make sure the hardware supports speech.
  248.             // All rules are run.
  249.             
  250.         pickAll,
  251.         {
  252.             rlCheckCPU,                                // A processor we can run on?
  253.             rlCheckSystemVersion,                    // Alert if system too old.
  254.             rlCheckBootable,                        // Alert if no system at all.
  255.             rlOKToInstall                            // Add package to install.
  256.         }
  257.     }}
  258. };
  259.  
  260. //------------------------------
  261. // Not speech capable system.  If the disk can be booted, report that chosen volume does
  262. // not have a speech-capable System.
  263. // This prevents Easy Install from installing.
  264.  
  265. resource 'inrl' ( rlCheckSystemVersion )
  266. {
  267.     format0
  268.     {{
  269.         checkAllAssertions{{ aProcessorOK }},        // Don't bother alerting if hardware missing.
  270.         checkAllAssertions{{ aBootableVolume }},    // Don't alert version if disk not bootable.
  271.         checkAllNonAssertions{{ aSystem7 }},
  272.         reportVolError
  273.         {
  274.             "Mexican Spanish Text-to-Speech requires System Software 7.0 or later."
  275.             "  Please click Switch Disk to choose another disk."
  276.         }
  277.     }}
  278. };
  279.  
  280. //------------------------------
  281. // Report that chosen volume is not a bootable disk.
  282. // This prevents Easy Install from installing.
  283.  
  284. resource 'inrl' ( rlCheckBootable )
  285. {
  286.     format0
  287.     {{
  288.         checkAllAssertions{{ aProcessorOK }},        // Don't bother alerting if hardware missing.
  289.         checkAllNonAssertions{{ aBootableVolume }},
  290.         reportVolError
  291.         {
  292.             "Mexican Spanish Text-to-Speech must be installed on a disk with system software on it."
  293.             "  Please click Switch Disk to choose another disk."
  294.         }
  295.     }}
  296. };
  297.  
  298. //------------------------------
  299. // Test for a processor we support.
  300.  
  301. resource 'inrl' ( rlCheckCPU )
  302. {
  303.     format0
  304.     {{
  305.         checkAllNonAssertions{{ aProcessorOK }},
  306.         reportVolError                        // Not ReportSysError so Custom Install is available.
  307.         {
  308.             "Mexican Spanish Text-to-Speech requires a Macintosh with a 68020 processor or better."
  309.             "  It will not run on this Macintosh.\n"
  310.         }
  311.     }}
  312. };
  313.  
  314. //------------------------------
  315. // Assume everything's OK and we can install.  If there was a reportVolError
  316. // that fired, the packages and user descriptions will be suppressed.
  317.  
  318. resource 'inrl' ( rlOKToInstall )
  319. {
  320.     format0
  321.     {{
  322.         addUserDescription {"• Mexican Spanish Text-to-Speech Software\n"},    //    message to appear in Easy Install screen
  323.         addPackages {{ pkInstallMexicanTTS }}
  324.     }}
  325. };
  326.  
  327.  
  328. /************************** Rule resources for Custom Install ********************************/
  329. // Rule framework.
  330.  
  331. resource 'infr' ( kCustomInstallFrameworkRsrcID )
  332.     format0
  333.     {{
  334.                 // Don't install unless System 7.0 or later is present.  It's OK if the
  335.                 // hardware isn't right; they may be installing on a disk to be taken
  336.                 // to another machine.
  337.                 
  338.             pickFirst,
  339.             {
  340.                 rlCustomCheckSystem,
  341.                 rlCustomSystemVersionError
  342.             }
  343.     }}
  344. };
  345.  
  346. //------------------------------
  347. // If System 7.0 or later, allow installation.
  348.  
  349. resource 'inrl' ( rlCustomCheckSystem )
  350. {
  351.     format0
  352.     {{
  353.         checkAllAssertions{{ aBootableVolume, aSystem7 }},
  354.         addCustomItems
  355.         {{
  356.             pkInstallMexicanTTS,
  357.             pkInstallSpeechMgrCustom
  358.         }}
  359.     }}
  360. };
  361.  
  362. //------------------------------
  363. // Report that chosen volume does not have a recognition-capable System.
  364. // This prevents Custom Install from installing.
  365.  
  366. resource 'inrl' ( rlCustomSystemVersionError )
  367. {
  368.     format0
  369.     {{
  370.         reportVolError
  371.         {
  372.             "Mexican Spanish Text-to-Speech requires System Software 7.0 or later."
  373.             "  Please click Switch Disk to choose another disk."
  374.         }
  375.     }}
  376. };
  377.  
  378. /***************************** Package Resources ************************************************/
  379. resource 'inpk' (pkInstallMexicanTTS) {
  380.     format0 {
  381.         showsOnCustom,                     // if a subpackage, then show in Custom Install
  382.         removable,                        // include package or subpackage as a removeable item
  383.         forceRestart,                    // make user reboot his computer after install
  384.         cmtIMexicanTTS,                     // ID of package comments ( 'inpc' ) rsrc defined below
  385.         0,                                // Package size ( if 0, filled in by ScriptCheck )
  386.         "Mexican Spanish Text-to-Speech Software",     // Custom Install selection text
  387.         {    
  388.                 // Remove misplaced voices.
  389.             'infa', sourceFileBase + fCarlosExtFolder;        //    Delete "Carlos"        (Extensions:)
  390.             'infa', sourceFileBase + fCatalinaExtFolder;    //    Delete "Catalina"    (Extensions:)
  391.  
  392.                 // Install.
  393.             'infa', sourceFileBase + fReadMe;                //    Install "Using Mexican Spanish TTS"
  394.             'infa', sourceFileBase + fSimpleText;            //    Install "SimpleText"
  395.             'infa', sourceFileBase + fSpeechCDevNoRemove;    //    Install "Speech"
  396.             'infa', sourceFileBase + fSpeechMgrNoRemove;    //    Install "Speech Manager"
  397.             'inra', sourceFileBase + fDefaultVoice;            //    Install Resource 'ttsp'    (Extensions:Speech Manager)
  398.             'infa', sourceFileBase + fSynth;                //    Install "MacinTalk Español Mexicano"
  399.             'infa', sourceFileBase + fCarlos;                //    Install "Carlos"
  400.             'infa', sourceFileBase + fCatalina;                //    Install "Catalina"
  401.         }
  402.     }
  403. };
  404.  
  405.  
  406. //============================================================
  407. // The Speech Manager packages for Custom Install/Remove.
  408.  
  409. //------------------------------
  410. // Speech Manager for System 7 or later, i.e. can install cdev.
  411.  
  412. resource 'inpk' (pkInstallSpeechMgrCustom)
  413. {
  414.     format0
  415.     {
  416.         doesntShowOnCustom,             // if a subpackage, then show in Custom Install
  417.         removable,                        // include package or subpackage as a removeable item
  418.         forceRestart,                    // make user reboot his computer after install
  419.         cmtISpeechMgr,                     // ID of package comments ( 'inpc' ) rsrc defined below
  420.         0,                                // Package size ( if 0, filled in by ScriptCheck )
  421.         "Speech Manager Software",         // Custom Install selection text
  422.         {    
  423.             'inpk', pkInstallSpeechMgrExtCustom;// Installs Package "Speech Manager Extension"
  424.             'inpk', pkInstallSpeechCDevCustom;// Installs Package "Speech Control Panel"
  425.         }
  426.     }
  427. };
  428.  
  429. //------------------------------
  430. // Sub-package for Speech Manager, System 7.  Allow user to install just the extension.
  431.  
  432. resource 'inpk' (pkInstallSpeechMgrExtCustom)
  433. {
  434.     format0
  435.     {
  436.         showsOnCustom,                     // if a subpackage, then show in Custom Install
  437.         removable,                        // include package or subpackage as a removeable item
  438.         forceRestart,                    // make user reboot his computer after install
  439.         cmtISpeechMgrExt,                 // ID of package comments ( 'inpc' ) rsrc defined below
  440.         0,                                // Package size ( if 0, filled in by ScriptCheck )
  441.         "Speech Manager Extension",     // Custom Install selection text
  442.         {    
  443.             'infa', sourceFileBase + fSpeechMgr;        //    Install "Speech Manager"
  444.         }
  445.     }
  446. };
  447.  
  448. //------------------------------
  449. // Sub-package for Speech Manager, System 7.  Allow user to install just the cdev.
  450.  
  451. resource 'inpk' (pkInstallSpeechCDevCustom)
  452. {
  453.     format0
  454.     {
  455.         showsOnCustom,                     // if a subpackage, then show in Custom Install
  456.         removable,                        // include package or subpackage as a removeable item
  457.         forceRestart,                    // make user reboot his computer after install
  458.         cmtISpeechCDev,                     // ID of package comments ( 'inpc' ) rsrc defined below
  459.         0,                                // Package size ( if 0, filled in by ScriptCheck )
  460.         "Speech Control Panel",         // Custom Install selection text
  461.         {    
  462.             'infa', sourceFileBase + fSpeechCDev;        //    Install "Speech"
  463.         }
  464.     }
  465. };
  466.  
  467. /***************************** Comments ************************************************/
  468. // NOTE: ignore the warning from ScriptCheck about these comments not being needed
  469. // because the packages have doesntShowOnCustom set.  The custom rules install the
  470. // packages and then the comments are available.
  471.  
  472. resource 'icmt' (cmtIMexicanTTS) {
  473.     currentReleaseDate,
  474.     kTTSVersionIcmt,
  475.     iconMexicanTTS,
  476.     "This package contains the software necessary to have Spanish text spoken aloud."
  477.     "  Useful on Macintoshes with a 68020 processor or better"
  478.     " and running System Software 7.0 or later."
  479. };
  480.  
  481. resource 'icmt' (cmtISpeechMgr) {
  482.     currentReleaseDate,
  483.     kTTSVersionIcmt,
  484.     iconSpeechMgr,
  485.     "This package contains the Speech Manager software, used by all text-to-speech synthesizers."
  486. };
  487.  
  488. resource 'icmt' (cmtISpeechMgrExt) {
  489.     currentReleaseDate,
  490.     kTTSVersionIcmt,
  491.     iconSpeechMgr,
  492.     "This package contains the Speech Manager Extension,"
  493.     " required for text-to-speech."
  494. };
  495.  
  496. resource 'icmt' (cmtISpeechCDev) {
  497.     currentReleaseDate,
  498.     kTTSVersionIcmt,
  499.     iconSpeechCDev,
  500.     "This package contains the Speech Control Panel,"
  501.     " used to select options for text-to-speech."
  502. };
  503.  
  504.  
  505. /***************************** Special File Specs *************************************/
  506.  
  507. resource 'intf' ( kTargetSystem )         /* File Spec */
  508. {
  509.     format0
  510.     {
  511.         noSearchForFile,
  512.         TypeCrNeedNotMatch,                // Type is 'ZSYS' for 6.0.7, 'zsys' for 7.0.
  513.         'zsys',
  514.         'MACS',
  515.         0x0,
  516.         "special-macs:System"
  517.     }
  518. };
  519.  
  520. resource 'infs' ( kTargetFinder ) {     /* File Spec */
  521.     'FNDR',
  522.     'MACS',
  523.     0x0,
  524.     noSearchForFile,
  525.     TypeCrMustMatch,
  526.     "special-macs:Finder"
  527. };
  528.  
  529.  
  530. /***************************** All Other File Specs *************************************/
  531. #include    "InstallFiles_TTS14_Mexican.r"
  532.